<?php
namespace App\Http\Requests;

class OrderRequest extends BaseRequest {

    public function createOrderRules()
    {
        return [
            'machineCode'       => 'required|exists:swt_machine,machine_no',
            'doorNum'           => 'required',
            'platform'          => 'required|in:wechat,alipay,card'
        ];
    }

    public function getOrderStatusRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id',
            'confirm'           => 'required'
        ];
    }

    public function getOrderFinishRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id'
        ];
    }

    public function getOrderDetailRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id'
        ];
    }

    public function setRefundOrderRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id',
            'refundAmount'      => 'required|numeric',
        ];
    }

    public function getRefundOrderDetailRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id'
        ];
    }

    public function payNeedFurtherOrderRules()
    {
        return [
            'orderId'           => 'required|exists:swt_order,id',
            'platform'          => 'required|in:wechat,alipay,card'
        ];
    }

    public function createCardOrderRules()
    {
        return [
            'machineCode'       => 'required|exists:swt_machine,machine_no',
            'doorNum'           => 'required',
            'cardNo'            => 'required'
        ];
    }
}
